import QtQuick 2.6
import QtQuick.Layouts 1.2

import "../Base/UiBase"
import "../Base/Config"

import Data 1.0

import "Nav" as Nav
import "Multi" as Multi
import "P2p" as P2p

Rectangle {
    id: root

    property int subject: User.subject

    color: Color.background

    ColumnLayout {
        anchors.fill: parent
        spacing: 0
        Nav.Index {
            id: head

            Layout.fillWidth: true
            Layout.preferredHeight: 96.0 * Size.ratio
            z: 1
            BottomDivider {
                visible: head.activeButtonName === "p2p"
            }
        }

        // body
        Item {
            Layout.fillWidth: true
            Layout.fillHeight: true

            Loader {
                anchors.fill: parent
                source: head.activeButtonName === "multi" ? "Multi/Index.qml" : "P2p/Index.qml"
            }
        } // end body
    }
}
